package com.zhy.springmvc.controller;

import com.zhy.springmvc.entity.Admin;

import com.zhy.springmvc.service.intf.AdminService;
import com.zhy.springmvc.vo.PageBean;
import com.zhy.springmvc.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


@Controller
@RequestMapping("/api/admin")
public class AdminController {
    @Autowired
    private AdminService adminService;

    @RequestMapping("/save.do")
    @ResponseBody
    public R save(Admin admin){
        return adminService.save(admin);
    }

    @RequestMapping("/all.do")
    @ResponseBody
    public PageBean All(){
        return adminService.qusertList();
    }
}
